package top.fullj.remoting;

import top.fullj.remoting.provider.NetworkConfig;
import top.fullj.remoting.provider.NetworkServer;
import top.fullj.remoting.provider.ServiceRegistry;

import java.io.IOException;

/**
 * @author bruce.wu
 * @since 2022/2/14 14:59
 */
public class ServerApp {

    public static final NetworkConfig NETWORK_CONFIG = new NetworkConfig("tcp", "127.0.0.1", 9901);

    public static void main(String[] args) throws IOException {
        ServiceRegistry.getInstance().register(new HelloServiceImpl());
        NetworkServer ns = new NetworkServer(NETWORK_CONFIG);
        Runtime.getRuntime().addShutdownHook(new Thread(ns::shutdown));
    }

}
